3.69 \(\int \frac{(c+d x)^2}{a+b \tanh (e+f x)} \, dx\)

Optimal. Leaf size=157 \[ \frac{b d (c+d x) \text{PolyLog}\left (2,-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{f^2 \left (a^2-b^2\right )}+\frac{b d^2 \text{PolyLog}\left (3,-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f^3 \left (a^2-b^2\right )}-\frac{b (c+d x)^2 \log \left (\frac{(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{f \left (a^2-b^2\right )}+\frac{(c+d x)^3}{3 d (a+b)} \]

[Out]

(c + d*x)^3/(3*(a + b)*d) - (b*(c + d*x)^2*Log[1 + (a - b)/((a + b)*E^(2*(e + f*x)))])/((a^2 - b^2)*f) + (b*d*
(c + d*x)*PolyLog[2, -((a - b)/((a + b)*E^(2*(e + f*x))))])/((a^2 - b^2)*f^2) + (b*d^2*PolyLog[3, -((a - b)/((
a + b)*E^(2*(e + f*x))))])/(2*(a^2 - b^2)*f^3)

________________________________________________________________________________________

Rubi [A]  time = 0.289654, antiderivative size = 157, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3732, 2190, 2531, 2282, 6589} \[ \frac{b d (c+d x) \text{PolyLog}\left (2,-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{f^2 \left (a^2-b^2\right )}+\frac{b d^2 \text{PolyLog}\left (3,-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f^3 \left (a^2-b^2\right )}-\frac{b (c+d x)^2 \log \left (\frac{(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{f \left (a^2-b^2\right )}+\frac{(c+d x)^3}{3 d (a+b)} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(a + b*Tanh[e + f*x]),x]

[Out]

(c + d*x)^3/(3*(a + b)*d) - (b*(c + d*x)^2*Log[1 + (a - b)/((a + b)*E^(2*(e + f*x)))])/((a^2 - b^2)*f) + (b*d*
(c + d*x)*PolyLog[2, -((a - b)/((a + b)*E^(2*(e + f*x))))])/((a^2 - b^2)*f^2) + (b*d^2*PolyLog[3, -((a - b)/((
a + b)*E^(2*(e + f*x))))])/(2*(a^2 - b^2)*f^3)

Rule 3732

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(d*
(m + 1)*(a + I*b)), x] + Dist[2*I*b, Int[((c + d*x)^m*E^Simp[2*I*(e + f*x), x])/((a + I*b)^2 + (a^2 + b^2)*E^S
imp[2*I*(e + f*x), x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[a^2 + b^2, 0] && IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2531

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> -Simp[((
f + g*x)^m*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)])/(b*c*n*Log[F]), x] + Dist[(g*m)/(b*c*n*Log[F]), Int[(f + g*x)
^(m - 1)*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin{align*} \int \frac{(c+d x)^2}{a+b \tanh (e+f x)} \, dx &=\frac{(c+d x)^3}{3 (a+b) d}+(2 b) \int \frac{e^{-2 (e+f x)} (c+d x)^2}{(a+b)^2+\left (a^2-b^2\right ) e^{-2 (e+f x)}} \, dx\\ &=\frac{(c+d x)^3}{3 (a+b) d}-\frac{b (c+d x)^2 \log \left (1+\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac{(2 b d) \int (c+d x) \log \left (1+\frac{\left (a^2-b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f}\\ &=\frac{(c+d x)^3}{3 (a+b) d}-\frac{b (c+d x)^2 \log \left (1+\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac{b d (c+d x) \text{Li}_2\left (-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}-\frac{\left (b d^2\right ) \int \text{Li}_2\left (-\frac{\left (a^2-b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f^2}\\ &=\frac{(c+d x)^3}{3 (a+b) d}-\frac{b (c+d x)^2 \log \left (1+\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac{b d (c+d x) \text{Li}_2\left (-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}+\frac{\left (b d^2\right ) \operatorname{Subst}\left (\int \frac{\text{Li}_2\left (\frac{(-a+b) x}{a+b}\right )}{x} \, dx,x,e^{-2 (e+f x)}\right )}{2 \left (a^2-b^2\right ) f^3}\\ &=\frac{(c+d x)^3}{3 (a+b) d}-\frac{b (c+d x)^2 \log \left (1+\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac{b d (c+d x) \text{Li}_2\left (-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}+\frac{b d^2 \text{Li}_3\left (-\frac{(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^3}\\ \end{align*}

Mathematica [A]  time = 3.69455, size = 191, normalized size = 1.22 \[ \frac{b \left (\frac{3 d \left (2 f (c+d x) \text{PolyLog}\left (2,\frac{(b-a) e^{-2 (e+f x)}}{a+b}\right )+d \text{PolyLog}\left (3,\frac{(b-a) e^{-2 (e+f x)}}{a+b}\right )\right )}{f^3 (a-b)}-\frac{6 (c+d x)^2 \log \left (\frac{(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{f (a-b)}-\frac{4 (c+d x)^3}{d \left (a \left (e^{2 e}+1\right )+b \left (e^{2 e}-1\right )\right )}\right )}{6 (a+b)}+\frac{x \cosh (e) \left (3 c^2+3 c d x+d^2 x^2\right )}{3 (a \cosh (e)+b \sinh (e))} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(a + b*Tanh[e + f*x]),x]

[Out]

(b*((-4*(c + d*x)^3)/(d*(b*(-1 + E^(2*e)) + a*(1 + E^(2*e)))) - (6*(c + d*x)^2*Log[1 + (a - b)/((a + b)*E^(2*(
e + f*x)))])/((a - b)*f) + (3*d*(2*f*(c + d*x)*PolyLog[2, (-a + b)/((a + b)*E^(2*(e + f*x)))] + d*PolyLog[3, (
-a + b)/((a + b)*E^(2*(e + f*x)))]))/((a - b)*f^3)))/(6*(a + b)) + (x*(3*c^2 + 3*c*d*x + d^2*x^2)*Cosh[e])/(3*
(a*Cosh[e] + b*Sinh[e]))

________________________________________________________________________________________

Maple [B]  time = 0.148, size = 720, normalized size = 4.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/(a+b*tanh(f*x+e)),x)

[Out]

1/3/(a+b)*d^2*x^3+1/(a+b)*c*d*x^2+1/(a+b)*c^2*x+2*b/(a+b)/f*c^2/(a-b)*ln(exp(f*x+e))-b/(a+b)/f*c^2/(a-b)*ln(a*
exp(2*f*x+2*e)+b*exp(2*f*x+2*e)+a-b)+2*b/(a+b)/f^3*d^2*e^2/(a-b)*ln(exp(f*x+e))-b/(a+b)/f^3*d^2*e^2/(a-b)*ln(a
*exp(2*f*x+2*e)+b*exp(2*f*x+2*e)+a-b)-2/3*b/(a+b)*d^2/(-a+b)*x^3+2*b/(a+b)/f^2*d^2/(-a+b)*e^2*x+4/3*b/(a+b)/f^
3*d^2/(-a+b)*e^3+b/(a+b)/f*d^2/(-a+b)*ln(1-(a+b)*exp(2*f*x+2*e)/(-a+b))*x^2-b/(a+b)/f^3*d^2/(-a+b)*ln(1-(a+b)*
exp(2*f*x+2*e)/(-a+b))*e^2+b/(a+b)/f^2*d^2/(-a+b)*polylog(2,(a+b)*exp(2*f*x+2*e)/(-a+b))*x-1/2*b/(a+b)/f^3*d^2
/(-a+b)*polylog(3,(a+b)*exp(2*f*x+2*e)/(-a+b))-4*b/(a+b)/f^2*c*d*e/(a-b)*ln(exp(f*x+e))+2*b/(a+b)/f^2*c*d*e/(a
-b)*ln(a*exp(2*f*x+2*e)+b*exp(2*f*x+2*e)+a-b)+2*b/(a+b)/f*c*d/(-a+b)*ln(1-(a+b)*exp(2*f*x+2*e)/(-a+b))*x+2*b/(
a+b)/f^2*c*d/(-a+b)*ln(1-(a+b)*exp(2*f*x+2*e)/(-a+b))*e-2*b/(a+b)*c*d/(-a+b)*x^2-4*b/(a+b)/f*c*d/(-a+b)*e*x-2*
b/(a+b)/f^2*c*d/(-a+b)*e^2+b/(a+b)/f^2*c*d/(-a+b)*polylog(2,(a+b)*exp(2*f*x+2*e)/(-a+b))

________________________________________________________________________________________

Maxima [B]  time = 1.60758, size = 455, normalized size = 2.9 \begin{align*} -\frac{{\left (2 \, f x \log \left (\frac{{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b} + 1\right ) +{\rm Li}_2\left (-\frac{{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b}\right )\right )} b c d}{a^{2} f^{2} - b^{2} f^{2}} - \frac{{\left (2 \, f^{2} x^{2} \log \left (\frac{{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b} + 1\right ) + 2 \, f x{\rm Li}_2\left (-\frac{{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b}\right ) -{\rm Li}_{3}(-\frac{{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b})\right )} b d^{2}}{2 \,{\left (a^{2} f^{3} - b^{2} f^{3}\right )}} - c^{2}{\left (\frac{b \log \left (-{\left (a - b\right )} e^{\left (-2 \, f x - 2 \, e\right )} - a - b\right )}{{\left (a^{2} - b^{2}\right )} f} - \frac{f x + e}{{\left (a + b\right )} f}\right )} + \frac{2 \,{\left (b d^{2} f^{3} x^{3} + 3 \, b c d f^{3} x^{2}\right )}}{3 \,{\left (a^{2} f^{3} - b^{2} f^{3}\right )}} + \frac{d^{2} x^{3} + 3 \, c d x^{2}}{3 \,{\left (a + b\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+b*tanh(f*x+e)),x, algorithm="maxima")

[Out]

-(2*f*x*log((a*e^(2*e) + b*e^(2*e))*e^(2*f*x)/(a - b) + 1) + dilog(-(a*e^(2*e) + b*e^(2*e))*e^(2*f*x)/(a - b))
)*b*c*d/(a^2*f^2 - b^2*f^2) - 1/2*(2*f^2*x^2*log((a*e^(2*e) + b*e^(2*e))*e^(2*f*x)/(a - b) + 1) + 2*f*x*dilog(
-(a*e^(2*e) + b*e^(2*e))*e^(2*f*x)/(a - b)) - polylog(3, -(a*e^(2*e) + b*e^(2*e))*e^(2*f*x)/(a - b)))*b*d^2/(a
^2*f^3 - b^2*f^3) - c^2*(b*log(-(a - b)*e^(-2*f*x - 2*e) - a - b)/((a^2 - b^2)*f) - (f*x + e)/((a + b)*f)) + 2
/3*(b*d^2*f^3*x^3 + 3*b*c*d*f^3*x^2)/(a^2*f^3 - b^2*f^3) + 1/3*(d^2*x^3 + 3*c*d*x^2)/(a + b)

________________________________________________________________________________________

Fricas [C]  time = 2.47721, size = 1269, normalized size = 8.08 \begin{align*} \frac{{\left (a + b\right )} d^{2} f^{3} x^{3} + 3 \,{\left (a + b\right )} c d f^{3} x^{2} + 3 \,{\left (a + b\right )} c^{2} f^{3} x + 6 \, b d^{2}{\rm polylog}\left (3, \sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) + 6 \, b d^{2}{\rm polylog}\left (3, -\sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 6 \,{\left (b d^{2} f x + b c d f\right )}{\rm Li}_2\left (\sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 6 \,{\left (b d^{2} f x + b c d f\right )}{\rm Li}_2\left (-\sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 3 \,{\left (b d^{2} e^{2} - 2 \, b c d e f + b c^{2} f^{2}\right )} \log \left (2 \,{\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \,{\left (a + b\right )} \sinh \left (f x + e\right ) + 2 \,{\left (a - b\right )} \sqrt{-\frac{a + b}{a - b}}\right ) - 3 \,{\left (b d^{2} e^{2} - 2 \, b c d e f + b c^{2} f^{2}\right )} \log \left (2 \,{\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \,{\left (a + b\right )} \sinh \left (f x + e\right ) - 2 \,{\left (a - b\right )} \sqrt{-\frac{a + b}{a - b}}\right ) - 3 \,{\left (b d^{2} f^{2} x^{2} + 2 \, b c d f^{2} x - b d^{2} e^{2} + 2 \, b c d e f\right )} \log \left (\sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right ) - 3 \,{\left (b d^{2} f^{2} x^{2} + 2 \, b c d f^{2} x - b d^{2} e^{2} + 2 \, b c d e f\right )} \log \left (-\sqrt{-\frac{a + b}{a - b}}{\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right )}{3 \,{\left (a^{2} - b^{2}\right )} f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+b*tanh(f*x+e)),x, algorithm="fricas")

[Out]

1/3*((a + b)*d^2*f^3*x^3 + 3*(a + b)*c*d*f^3*x^2 + 3*(a + b)*c^2*f^3*x + 6*b*d^2*polylog(3, sqrt(-(a + b)/(a -
 b))*(cosh(f*x + e) + sinh(f*x + e))) + 6*b*d^2*polylog(3, -sqrt(-(a + b)/(a - b))*(cosh(f*x + e) + sinh(f*x +
 e))) - 6*(b*d^2*f*x + b*c*d*f)*dilog(sqrt(-(a + b)/(a - b))*(cosh(f*x + e) + sinh(f*x + e))) - 6*(b*d^2*f*x +
 b*c*d*f)*dilog(-sqrt(-(a + b)/(a - b))*(cosh(f*x + e) + sinh(f*x + e))) - 3*(b*d^2*e^2 - 2*b*c*d*e*f + b*c^2*
f^2)*log(2*(a + b)*cosh(f*x + e) + 2*(a + b)*sinh(f*x + e) + 2*(a - b)*sqrt(-(a + b)/(a - b))) - 3*(b*d^2*e^2
- 2*b*c*d*e*f + b*c^2*f^2)*log(2*(a + b)*cosh(f*x + e) + 2*(a + b)*sinh(f*x + e) - 2*(a - b)*sqrt(-(a + b)/(a
- b))) - 3*(b*d^2*f^2*x^2 + 2*b*c*d*f^2*x - b*d^2*e^2 + 2*b*c*d*e*f)*log(sqrt(-(a + b)/(a - b))*(cosh(f*x + e)
 + sinh(f*x + e)) + 1) - 3*(b*d^2*f^2*x^2 + 2*b*c*d*f^2*x - b*d^2*e^2 + 2*b*c*d*e*f)*log(-sqrt(-(a + b)/(a - b
))*(cosh(f*x + e) + sinh(f*x + e)) + 1))/((a^2 - b^2)*f^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (c + d x\right )^{2}}{a + b \tanh{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/(a+b*tanh(f*x+e)),x)

[Out]

Integral((c + d*x)**2/(a + b*tanh(e + f*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (d x + c\right )}^{2}}{b \tanh \left (f x + e\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+b*tanh(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)^2/(b*tanh(f*x + e) + a), x)